import React, {useState, useEffect} from 'react'
import { Outlet, useNavigate, Navigate } from 'react-router-dom';
import { setNavigate } from '@utils/navigation'
import './styles/index.less'

const Login = (props) => {
  const navigate = useNavigate();

  useEffect(() => {
    setNavigate(navigate)
  }, [navigate])

  useEffect(() => {
  }, [])

  if (localStorage.getItem('zg-jwt')) return <Navigate to="/" />

  return (
    <>
      <div className="drag-top"></div>
      <div className="login">
        <div className="sidebar">
          <i className="logo"></i>
          <i className="bg-image"></i>
          <p>小账大财，鲸算未来</p>
        </div>
        <Outlet />
      </div>
    </>
  )
}

export default Login;